Skip to content

Accept validated headerless SSE from Responses provider - #15

Merged
AppSolves merged 3 commits into
mainfrom
fix/headerless-sse-stream-validation
Nov 14, 2026
Merged

AppSolves merged 3 commits into
mainfrom
fix/headerless-sse-stream-validation

Conversation

@AppSolves

Copy link
Copy Markdown
Owner

Evidence

Production TopkAPI Actions run 43627763636 received upstream HTTP 200, content_type_category=missing, body_present=true from the public Responses endpoint and failed provider_stream_content_type_invalid. An independently reported Codex streaming gateway case also documents HTTP 200 with an SSE body and no Content-Type, but on a distinct endpoint; therefore actual upstream body shape is not yet established here.

Change

For successful Responses responses with missing Content-Type only, peek at most 64 bytes from a cloned response to require an event: or data: SSE prefix. Then feed the original body into the existing bounded safeEvents verifier, which requires a terminal response.completed; all failures remain fail closed. A present JSON/HTML/other media type stays rejected. Existing sanitized diagnostics, credential isolation, fixed upstream endpoint and origin/transport policies are unchanged.

Safety and rollout

This is a proposed production fix, not proof of a successful live review. Check CI and run full synthetic Docker/SSE and security tests before approval. No live inference was performed. Do not merge or deploy automatically. Because the runner is immutable-pinned, a coordinated Worker trust/caller SHA update is required after squash merge. Keep auto-merge disabled. One new owner-authorized review is needed only after deployment and credential-only diagnostics.

Reference: QuantumNous/new-api#6075 (analogous headerless SSE behavior on a different endpoint).

@AppSolves
AppSolves marked this pull request as ready for review November 14, 2026 18:56
@AppSolves
AppSolves merged commit 2172cf1 into main Nov 14, 2026
4 checks passed
@AppSolves
AppSolves deleted the fix/headerless-sse-stream-validation branch November 14, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant